﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace TanmiaGrp.Basis.Specification
{
    public class GenericSpecification<T> : BaseSpecification<T>
    {

        public GenericSpecification(Expression<Func<T, int>> selection)
        {
            this.Selection = selection;
        }

        public GenericSpecification(Expression<Func<T, bool>> predicate, GenericFetchStrategy<T> fetch)
        {
            this.Predicate = predicate;
            this.FetchStartegy = fetch;
        }

        public GenericSpecification(Expression<Func<T, bool>> predicate)
        {
            this.Predicate = predicate;
        }


        public GenericSpecification(int pageIndex, int pageSize)
        {
            this.PageIndex = pageIndex;
            this.PageSize = pageSize;
        }

        public GenericSpecification(int pageIndex, int pageSize, Expression<Func<T, bool>> predicate)
        {
            this.PageIndex = pageIndex;
            this.PageSize = pageSize;
            this.Predicate = predicate;
        }

        public GenericSpecification()
        {
        }
    }
}
